<?
include "uconnect.php";

// Grab the Price & Ore Data Arrays & Strings
include "../functions/arrayData.php";

// Function for the Profit Calculation
function profit($modMe)
	{
		$a = intval($modMe);
		$b = $a * .80; //% paid out
		$c = intval($b);
		$d = $c/100; //divide back to cents
		return $d;
	};
	
// Function for the Sell Calculation
function sellMe($sellMe)
	{
		$a = intval($sellMe);
		$b = $a * .925; //% sold for
		$c = intval($b);
		$d = $c/100; //divide back to cents
		return $d;
	};

// Rename those prices for less typing
$ptri = $pDA['tritanium']['price'];
$ppye = $pDA['pyerite']['price'];
$pmex = $pDA['mexallon']['price'];
$piso = $pDA['isogen']['price'];
$pnoc = $pDA['nocxium']['price'];
$pzyd = $pDA['zydrine']['price'];
$pmeg = $pDA['megacyte']['price'];
$pmor = $pDA['morphite']['price'];

// Calculate the Values of Each Ore type
// Ore Data Array = $oDA
// Price Data Array = $pDA 

// Veldspar = Tri
$veld1 = (($ptri * $oDA['veld']['tritanium']) / $oDA['veld']['batch']); 
$veld2 = (($ptri * $oDA['cveld']['tritanium']) / $oDA['cveld']['batch']);
$veld3 = (($ptri * $oDA['dveld']['tritanium']) / $oDA['dveld']['batch']);

// Scordite = Tri + Pye
$scor1 = ((($ptri * $oDA['scor']['tritanium']) + $ppye * $oDA['scor']['pyerite']) / $oDA['scor']['batch']);
$scor2 = ((($ptri * $oDA['cscor']['tritanium']) + $ppye * $oDA['cscor']['pyerite']) / $oDA['cscor']['batch']);
$scor3 = ((($ptri * $oDA['mscor']['tritanium']) + $ppye * $oDA['mscor']['pyerite']) / $oDA['mscor']['batch']);

// Pyroxeres = Tri + Pye + Mex + Noc
$pyro1 = ((((($ptri * $oDA['pyro']['tritanium']) + $ppye * $oDA['pyro']['pyerite']) + $pmex * $oDA['pyro']['mexallon']) + $pnoc * $oDA['pyro']['nocxium']) / $oDA['pyro']['batch']);
$pyro2 = ((((($ptri * $oDA['spyro']['tritanium']) + $ppye * $oDA['spyro']['pyerite']) + $pmex * $oDA['spyro']['mexallon']) + $pnoc * $oDA['spyro']['nocxium']) / $oDA['spyro']['batch']);
$pyro3 = ((((($ptri * $oDA['vpyro']['tritanium']) + $ppye * $oDA['vpyro']['pyerite']) + $pmex * $oDA['vpyro']['mexallon']) + $pnoc * $oDA['vpyro']['nocxium']) / $oDA['vpyro']['batch']);

// Plagioclase
$plag1 = (((($ptri * $oDA['plag']['tritanium']) + $ppye * $oDA['plag']['pyerite']) + $pmex * $oDA['plag']['mexallon']) / $oDA['plag']['batch']);
$plag2 = (((($ptri * $oDA['aplag']['tritanium']) + $ppye * $oDA['aplag']['pyerite']) + $pmex * $oDA['aplag']['mexallon']) / $oDA['aplag']['batch']);
$plag3 = (((($ptri * $oDA['rplag']['tritanium']) + $ppye * $oDA['rplag']['pyerite']) + $pmex * $oDA['rplag']['mexallon']) / $oDA['rplag']['batch']);

// Omber = tri + pye + iso -- Short Name "omb" "somb" "gomb"
$omb1 = (((($ptri * $oDA['omb']['tritanium']) + $ppye * $oDA['omb']['pyerite']) + $piso * $oDA['omb']['isogen']) / $oDA['omb']['batch']);
$omb2 = (((($ptri * $oDA['somb']['tritanium']) + $ppye * $oDA['somb']['pyerite']) + $piso * $oDA['somb']['isogen']) / $oDA['somb']['batch']);
$omb3 = (((($ptri * $oDA['gomb']['tritanium']) + $ppye * $oDA['gomb']['pyerite']) + $piso * $oDA['gomb']['isogen']) / $oDA['gomb']['batch']);

// Kernite = tri + mex + iso
$kern1 = (((($ptri * $oDA['kern']['tritanium']) + $pmex * $oDA['kern']['mexallon']) + $piso * $oDA['kern']['isogen']) / $oDA['kern']['batch']);
$kern2 = (((($ptri * $oDA['lkern']['tritanium']) + $pmex * $oDA['lkern']['mexallon']) + $piso * $oDA['lkern']['isogen']) / $oDA['lkern']['batch']);
$kern3 = (((($ptri * $oDA['fkern']['tritanium']) + $pmex * $oDA['fkern']['mexallon']) + $piso * $oDA['fkern']['isogen']) / $oDA['fkern']['batch']);

// Jaspet = tri + pye + mex + noc
$jasp1 = ((((($ptri * $oDA['jasp']['tritanium']) + $ppye * $oDA['jasp']['pyerite']) + $pmex * $oDA['jasp']['mexallon']) + $pnoc * $oDA['jasp']['nocxium']) / $oDA['jasp']['batch']);
$jasp2 = ((((($ptri * $oDA['pujasp']['tritanium']) + $ppye * $oDA['pujasp']['pyerite']) + $pmex * $oDA['pujasp']['mexallon']) + $pnoc * $oDA['pujasp']['nocxium']) / $oDA['pujasp']['batch']);
$jasp3 = ((((($ptri * $oDA['prjasp']['tritanium']) + $ppye * $oDA['prjasp']['pyerite']) + $pmex * $oDA['prjasp']['mexallon']) + $pnoc * $oDA['prjasp']['nocxium']) / $oDA['prjasp']['batch']);

// Hemorphite = tri + iso + noc + zyd
$hemo1 = ((((($ptri * $oDA['hemo']['tritanium']) + $piso * $oDA['hemo']['isogen']) + $pnoc * $oDA['hemo']['nocxium']) + $pzyd * $oDA['hemo']['zydrine']) / $oDA['hemo']['batch']);
$hemo2 = ((((($ptri * $oDA['vhemo']['tritanium']) + $piso * $oDA['vhemo']['isogen']) + $pnoc * $oDA['vhemo']['nocxium']) + $pzyd * $oDA['vhemo']['zydrine']) / $oDA['vhemo']['batch']);
$hemo3 = ((((($ptri * $oDA['rhemo']['tritanium']) + $piso * $oDA['rhemo']['isogen']) + $pnoc * $oDA['rhemo']['nocxium']) + $pzyd * $oDA['rhemo']['zydrine']) / $oDA['rhemo']['batch']);

// Hedbergite = iso + noc + zyd
$hed1 = (((($piso * $oDA['hed']['isogen']) + $pnoc * $oDA['hed']['nocxium']) + $pzyd * $oDA['hed']['zydrine']) / $oDA['hed']['batch']);
$hed2 = (((($piso * $oDA['vhed']['isogen']) + $pnoc * $oDA['vhed']['nocxium']) + $pzyd * $oDA['vhed']['zydrine']) / $oDA['vhed']['batch']);
$hed3 = (((($piso * $oDA['ghed']['isogen']) + $pnoc * $oDA['ghed']['nocxium']) + $pzyd * $oDA['ghed']['zydrine']) / $oDA['ghed']['batch']);

// Gneiss = tri + mex + iso + zyd
$gne1 = ((((($ptri * $oDA['gne']['tritanium']) + $pmex * $oDA['gne']['mexallon']) + $piso * $oDA['gne']['isogen']) + $pzyd * $oDA['gne']['zydrine']) / $oDA['gne']['batch']);
$gne2 = ((((($ptri * $oDA['igne']['tritanium']) + $pmex * $oDA['igne']['mexallon']) + $piso * $oDA['igne']['isogen']) + $pzyd * $oDA['igne']['zydrine']) / $oDA['igne']['batch']);
$gne3 = ((((($ptri * $oDA['pgne']['tritanium']) + $pmex * $oDA['pgne']['mexallon']) + $piso * $oDA['pgne']['isogen']) + $pzyd * $oDA['pgne']['zydrine']) / $oDA['pgne']['batch']);

// Ochre = tri + noc + zyd
$och1 = (((($ptri * $oDA['doch']['tritanium']) + $pnoc * $oDA['doch']['nocxium']) + $pzyd * $oDA['doch']['zydrine']) / $oDA['doch']['batch']);
$och2 = (((($ptri * $oDA['onoch']['tritanium']) + $pnoc * $oDA['onoch']['nocxium']) + $pzyd * $oDA['onoch']['zydrine']) / $oDA['onoch']['batch']);
$och3 = (((($ptri * $oDA['oboch']['tritanium']) + $pnoc * $oDA['oboch']['nocxium']) + $pzyd * $oDA['oboch']['zydrine']) / $oDA['oboch']['batch']);

// Crokite = tri + nox + zyd
$crok1 = (((($ptri * $oDA['crok']['tritanium']) + $pnoc * $oDA['crok']['nocxium']) + $pzyd * $oDA['crok']['zydrine']) / $oDA['crok']['batch']);
$crok2 = (((($ptri * $oDA['scrok']['tritanium']) + $pnoc * $oDA['scrok']['nocxium']) + $pzyd * $oDA['scrok']['zydrine']) / $oDA['scrok']['batch']);
$crok3 = (((($ptri * $oDA['ccrok']['tritanium']) + $pnoc * $oDA['ccrok']['nocxium']) + $pzyd * $oDA['ccrok']['zydrine']) / $oDA['ccrok']['batch']);

// Spodumain = tri + pye + meg
$spod1 = (((($ptri * $oDA['spod']['tritanium']) + $ppye * $oDA['spod']['pyerite']) + $pmeg * $oDA['spod']['megacyte']) / $oDA['spod']['batch']);
$spod2 = (((($ptri * $oDA['bspod']['tritanium']) + $ppye * $oDA['bspod']['pyerite']) + $pmeg * $oDA['bspod']['megacyte']) / $oDA['bspod']['batch']);
$spod3 = (((($ptri * $oDA['gspod']['tritanium']) + $ppye * $oDA['gspod']['pyerite']) + $pmeg * $oDA['gspod']['megacyte']) / $oDA['gspod']['batch']);

// Bistot = pye + zyd + meg
$bist1 = (((($ppye * $oDA['bist']['pyerite']) + $pzyd * $oDA['bist']['zydrine']) + $pmeg * $oDA['bist']['megacyte']) / $oDA['bist']['batch']);
$bist2 = (((($ppye * $oDA['tbist']['pyerite']) + $pzyd * $oDA['tbist']['zydrine']) + $pmeg * $oDA['tbist']['megacyte']) / $oDA['tbist']['batch']);
$bist3 = (((($ppye * $oDA['mbist']['pyerite']) + $pzyd * $oDA['mbist']['zydrine']) + $pmeg * $oDA['mbist']['megacyte']) / $oDA['mbist']['batch']);

// Arkonor = tri + zyd + meg
$ark1 = (((($ptri * $oDA['ark']['tritanium']) + $pzyd * $oDA['ark']['zydrine']) + $pmeg * $oDA['ark']['megacyte']) / $oDA['ark']['batch']);
$ark2 = (((($ptri * $oDA['cark']['tritanium']) + $pzyd * $oDA['cark']['zydrine']) + $pmeg * $oDA['cark']['megacyte']) / $oDA['cark']['batch']);
$ark3 = (((($ptri * $oDA['park']['tritanium']) + $pzyd * $oDA['park']['zydrine']) + $pmeg * $oDA['park']['megacyte']) / $oDA['park']['batch']);

// Mercoxit = mor
$merc1 = (($pmor * $oDA['merc']['morphite']) / $oDA['merc']['batch']); 
$merc2 = (($pmor * $oDA['mmerc']['morphite']) / $oDA['mmerc']['batch']); 
$merc3 = (($pmor * $oDA['vmerc']['morphite']) / $oDA['vmerc']['batch']); 


?>